package com.xy.breakfast.entity;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Objects;

public class Foods implements java.io.Serializable{
    private int id;
    private int typesId;
    private String name;
    private String pic;
    private BigDecimal price;
    private int num;
    private Timestamp createTime;
    private String detail;

    //一对一外键
    public Foods foods;
    public Clients clients;
    public Products products;

    public Foods getFoods() {
        return foods;
    }

    public void setFoods(Foods foods) {
        this.foods = foods;
    }

    public Clients getClients() {
        return clients;
    }

    public void setClients(Clients clients) {
        this.clients = clients;
    }

    public Products getProducts() {
        return products;
    }

    public void setProducts(Products products) {
        this.products = products;
    }

    public Foods() {
    }

    public Foods(int id, int typesId, String name, String pic, BigDecimal price, int num, Timestamp createTime, String detail) {
        this.id = id;
        this.typesId = typesId;
        this.name = name;
        this.pic = pic;
        this.price = price;
        this.num = num;
        this.createTime = createTime;
        this.detail = detail;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getTypesId() {
        return typesId;
    }

    public void setTypesId(int typesId) {
        this.typesId = typesId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Foods foods = (Foods) o;
        return id == foods.id && typesId == foods.typesId && num == foods.num && Objects.equals(name, foods.name) && Objects.equals(pic, foods.pic) && Objects.equals(price, foods.price) && Objects.equals(createTime, foods.createTime) && Objects.equals(detail, foods.detail);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, typesId, name, pic, price, num, createTime, detail);
    }
}
